<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div id="app">
        <ul>
            <!-- vue2    v-for  >   v-if -->
            <!-- <li v-for="item in 10" v-if="item > 5">
                {{ item }}
            </li> -->

            <!-- <li v-for="item in list" v-if="item.id > 3">
                {{ item }}
            </li> -->

            <li v-for="item in newList">
                {{ item.id }}
            </li>
        </ul>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>

        new Vue({
            // 元素
            el: "#app",
            // 定义的数据(状态)
            data: {
               list: [
                 {
                    id: 1
                 },
                 {
                    id: 2
                 },
                 {
                    id: 3
                 },
                 {
                    id: 4
                 },
                 {
                    id: 5
                 }
               ]
            },
            methods: {
               
            },
            computed: {
                newList() {
                    return this.list.filter(item => item.id > 3)
                }
            }
        })
    </script>
</body>

</html>